/**
 * 关于社保和公积金的表头（异动和管理）
 */

// 商保异动管理表头
export const CIChangesManageThead = [
  {
    type: 'selection',
    width: 60,
    align: 'center',
    fixed: 'left'
  },
  {
    title: '公司名称',
    minWidth: 200,
    align: 'center',
    key: 'companyName',
    render: (h, params) => {
      let row = params.row
      let name = row.companyName
      if (row.statusName === '待申报') {
        return h('div', {
          // class: 'ellipsis'
        }, [
          h('span', {
            class: 'iconfont icon-new'
          }, ''),
          h('span', name)
        ])
      } else {
        return h('div', name)
      }
    }
  },
  {
    title: '异动类型',
    minWidth: 100,
    align: 'center',
    key: 'ChangeType',
    render: (h, params) => {
      let row = params.row
      let times = row.columns.ChangeType
      return h('span', times)
    }
  },
  {
    title: '姓名',
    minWidth: 90,
    align: 'center',
    key: 'name',
    fixed: 'left'
  },
  {
    title: '身份证号码',
    minWidth: 190,
    align: 'center',
    key: 'identityCardNO',
    fixed: 'left'
  },
  {
    title: '性别',
    minWidth: 80,
    align: 'center',
    key: 'sex',
    render: (h, params) => {
      let row = params.row
      let times = row.columns.Sex
      return h('span', times)
    }
  },
  {
    title: '出生日期',
    minWidth: 160,
    align: 'center',
    key: 'birthDay',
    render: (h, params) => {
      let row = params.row
      let times = row.birthDay.slice(0, 10).replace(/-/g, '')
      return h('span', times)
    }
  },
  {
    title: '年龄',
    minWidth: 80,
    align: 'center',
    key: 'age'
  },
  {
    title: '职业',
    minWidth: 160,
    align: 'center',
    key: 'duty'
  },
  {
    title: '处理结果',
    minWidth: 100,
    align: 'center',
    key: 'statusName'
  },
  {
    title: '申报失败原因',
    minWidth: 150,
    align: 'center',
    key: 'declareReason'
  },
  {
    title: '商保编号',
    minWidth: 150,
    tooltip: true,
    align: 'center',
    key: 'securityNO'
  },
  {
    title: '商保专员',
    align: 'center',
    minWidth: 110,
    key: 'commissionerUserName'
  },
  {
    title: '所属客服',
    minWidth: 120,
    align: 'center',
    key: 'serverName'
  },
  {
    title: '申报时间',
    minWidth: 160,
    align: 'center',
    key: 'changeTime',
    render: (h, params) => {
      let row = params.row
      let times = row.changeTime.slice(0, 10).replace(/-/g, '')
      return h('span', times)
    }
  },
  {
    title: '被替换人姓名',
    minWidth: 120,
    align: 'center',
    key: 'replace_Name'
  },
  {
    title: '被替换人性别',
    minWidth: 120,
    align: 'center',
    key: 'replace_Sex',
    render: (h, params) => {
      let row = params.row
      let times = row.columns.Replace_Sex
      return h('span', times)
    }
  },
  {
    title: '被替换人身份证号码',
    minWidth: 190,
    align: 'center',
    key: 'replace_IdentityCardNO'
  },
  {
    title: '离职原因',
    width: '150px',
    align: 'center',
    key: 'leaveReason'
  },
  {
    title: '手机号码',
    width: '150px',
    align: 'center',
    key: 'phone'
  },
  {
    title: '备注',
    minWidth: 150,
    align: 'center',
    key: 'description'
  },
  {
    title: '创建时间',
    width: 160,
    align: 'center',
    key: 'auditTime',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.auditTime) {
        times = row.auditTime.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  },
  {
    title: '操作',
    minWidth: 180,
    align: 'center',
    slot: 'action',
    fixed: 'right'
  },
]

// 商保异动查询管理表头
export const CIChangesVerifyManageThead = [
  {
    type: 'selection',
    width: 60,
    align: 'center',
    fixed: 'left'
  },
  {
    title: '公司名称',
    minWidth: 200,
    align: 'center',
    key: 'companyName',
    render: (h, params) => {
      let row = params.row
      let name = row.companyName
      if (row.statusName === '待审核' || row.columns.CancelStatus === '撤销申请中') {
        return h('div', {
          // class: 'ellipsis'
        }, [
          h('span', {
            class: 'iconfont icon-new'
          }, ''),
          h('span', name)
        ])
      } else {
        return h('div', name)
      }
    }
  },
  {
    title: '异动类型',
    minWidth: 100,
    align: 'center',
    key: 'ChangeType',
    render: (h, params) => {
      let row = params.row
      let times = row.columns.ChangeType
      return h('span', times)
    }
  },
  {
    title: '身份证号码',
    minWidth: 190,
    align: 'center',
    key: 'identityCardNO'
  },
  {
    title: '姓名',
    minWidth: 90,
    align: 'center',
    key: 'name'
  },
  {
    title: '性别',
    minWidth: 80,
    align: 'center',
    key: 'sex',
    render: (h, params) => {
      let row = params.row
      let times = row.columns.Sex
      return h('span', times)
    }
  },
  {
    title: '出生日期',
    minWidth: 160,
    align: 'center',
    key: 'birthDay',
    render: (h, params) => {
      let row = params.row
      let times = row.birthDay.slice(0, 10).replace(/-/g, '')
      return h('span', times)
    }
  },
  {
    title: '年龄',
    minWidth: 80,
    align: 'center',
    key: 'age'
  },
  {
    title: '职业',
    minWidth: 160,
    align: 'center',
    key: 'duty'
  },
  {
    title: '处理结果',
    minWidth: 100,
    align: 'center',
    key: 'statusName'
  },
  {
    title: '退回原因',
    minWidth: 150,
    tooltip: true,
    align: 'center',
    key: 'backReason'
  },
  {
    title: '撤销结果',
    minWidth: 100,
    align: 'center',
    key: 'cancelStatus',
    render: (h, params) => {
      let row = params.row
      let str = row.columns.CancelStatus
      return h('span', str)
    }
  },
  {
    title: '商保编号',
    minWidth: 150,
    tooltip: true,
    align: 'center',
    key: 'securityNO'
  },
  {
    title: '所属客服',
    minWidth: 100,
    align: 'center',
    key: 'serverName'
  },
  {
    title: '申报时间',
    minWidth: 160,
    align: 'center',
    key: 'changeTime',
    render: (h, params) => {
      let row = params.row
      let times = row.changeTime.slice(0, 10).replace(/-/g, '')
      return h('span', times)
    }
  },
  {
    title: '被替换人姓名',
    minWidth: 120,
    align: 'center',
    key: 'replace_Name'
  },
  {
    title: '被替换人性别',
    minWidth: 120,
    align: 'center',
    key: 'replace_Sex',
    render: (h, params) => {
      let row = params.row
      let times = row.columns.Replace_Sex
      return h('span', times)
    }
  },
  {
    title: '被替换人身份证号码',
    minWidth: 170,
    align: 'center',
    key: 'replace_IdentityCardNO'
  },
  {
    title: '离职原因',
    width: '150px',
    align: 'center',
    key: 'leaveReason'
  },
  {
    title: '手机号码',
    width: '150px',
    align: 'center',
    key: 'phone'
  },
  {
    title: '备注',
    minWidth: 150,
    align: 'center',
    key: 'description'
  },
  {
    title: '创建时间',
    width: 160,
    align: 'center',
    key: 'createdOn',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.createdOn) {
        times = row.createdOn.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  },
  {
    title: '操作',
    minWidth: 180,
    align: 'center',
    slot: 'action',
    fixed: 'right'
  },
]
